import {createWebHashHistory, createRouter} from "vue-router";

import Login from '@/views/Login.vue';

import OwnerHome from '@/views/owner/OwnerHome.vue'; // 假设业主首页组件
import PersonalCenter from '@/views/owner/PersonalCenter.vue';
import NoticeCenter from '@/views/owner/NoticeCenter.vue';
import PaymentCenter from '@/views/owner/PaymentCenter.vue';
import RepairCenter from '@/views/owner/RepairCenter.vue';
import ComplaintSuggestionCenter from '@/views/owner/ComplaintSuggestionCenter.vue';
import ParkingUseCenter from '@/views/owner/ParkingUseCenter.vue';

import PropertyHome from '@/views/property/PropertyHome.vue';
import P_PersonalCenter from '@/views/property/PersonalCenter.vue';
import OwnerInfo from '@/views/property/OwnerInfo.vue';
import NoticeManagement from '@/views/property/NoticeManagement.vue';
import FeeCollection from '@/views/property/ChargeManagement.vue';
import RepairHandling from '@/views/property/RepairHandling.vue';
import ComplaintSuggestionHandling from '@/views/property/ComplaintSuggestionHandling.vue';

import ParkingsManagement from '@/views/property/parkingsManagement.vue';

import AdminHome from '../views/admin/AdminHome.vue';
import UserStatistics from '../views/admin/UserStatistics.vue';
import ComplaintSuggestionStats from '../views/admin/ComplaintSuggestionStats.vue';
import UserActivityLog from '../views/admin/UserActivityLog.vue';
import ChargeDetailManagement from '../views/admin/ChargeDetailManagement.vue';
import ChargeItemManagement from '../views/admin/ChargeItemManagement.vue';
import CommunityInfoManagement from '../views/admin/CommunityInfoManagement.vue';
import BuildingInfoManagement from '../views/admin/BuildingInfoManagement.vue';
import HouseInfoManagement from '../views/admin/HouseInfoManagement.vue';
import NoticeStatistics from '../views/admin/NoticeStatistics.vue';
import RepairManagement from '../views/admin/RepairManagement.vue';
import ParkingManagement from '../views/admin/ParkingManagement.vue';
import ParkingUseDetail from '../views/admin/ParkingUseDetail.vue';
import StatisticsUsers from "@/views/admin/StatisticsUsers.vue";
import StatisticsParking from "@/views/admin/StatisticsParking.vue";
import StatisticsComplaints from "@/views/admin/StatisticsComplaints.vue";

const routes = [
    {
        path: "/",
        name: "Login",
        component: Login,
    },
    {
        path:"/owner",
        name: "OwnerHome",
        component: OwnerHome,
        children:[
            {
                path: '',
                redirect: 'personal-center'
            },
            {
                path: '/personal-center',
                name: 'PersonalCenter',
                component: PersonalCenter
            },
            {
                path: '/notice-center',
                name: 'NoticeCenter',
                component: NoticeCenter
            },
            {
                path: '/payment-center',
                name: 'PaymentCenter',
                component: PaymentCenter
            },
            {
                path:'/repair-center',
                name: 'RepairCenter',
                component: RepairCenter
            },
            {
                path: '/complaint-suggestion-center',
                name: 'ComplaintSuggestionCenter',
                component: ComplaintSuggestionCenter
            },
            {
                path: '/parking-use-center',
                name: 'ParkingUseCenter',
                component: ParkingUseCenter
            }
        ]
    },
    {
        path: '/property',
        name: 'PropertyHome',
        component: PropertyHome,
        children: [
            {
                path: '',
                redirect: 'p-personal-center'
            },
            {
                path: '/p-personal-center',
                name: 'PropertyPersonalCenter',
                component: P_PersonalCenter
            },
            {
                path: '/owner-info',
                name: 'OwnerInfo',
                component: OwnerInfo
            },
            {
                path: '/notice-management',
                name: 'NoticeManagement',
                component: NoticeManagement
            },
            {
                path: '/property-fee-collection',
                name: 'PropertyFeeCollection',
                component: FeeCollection
            },
            {
                path:'/repair-handling',
                name: 'RepairHandling',
                component: RepairHandling
            },
            {
                path: '/complaint-suggestion-handling',
                name: 'ComplaintSuggestionHandling',
                component: ComplaintSuggestionHandling
            },
            {
                path: '/parkings-management',
                name: 'ParkingsManagement',
                component: ParkingsManagement
            }
        ]
    },
    {
        path: '/admin',
        name: 'AdminHome',
        component: AdminHome,
        children: [
            {
                path: '',
                redirect: 'statistics-users'
            },
            {
                path: '/statistics-users',
                name: 'StatisticsUsers',
                component: StatisticsUsers
            },
            {
                path: '/statistics-complaints',
                name: 'StatisticsComplaints',
                component: StatisticsComplaints
            },
            {
                path: '/statistics-parking',
                name: 'StatisticsParking',
                component: StatisticsParking
            },
            {
                path: '/user-statistics',
                name: 'UserStatistics',
                component: UserStatistics
            },
            {
                path: '/complaint-suggestion-stats',
                name: 'ComplaintSuggestionStats',
                component: ComplaintSuggestionStats
            },
            {
                path: '/user-activity-log',
                name: 'UserActivityLog',
                component: UserActivityLog
            },
            {
                path: '/notice-statistics',
                name: 'NoticeStatistics',
                component: NoticeStatistics
            },
            {
                path: '/repair-management',
                name: 'RepairManagement',
                component: RepairManagement
            },
            {
                path: '/parking-use-detail',
                name: 'ParkingUseDetail',
                component: ParkingUseDetail
            },
            {
                path: '/charge-item-management',
                name: 'ChargeItemManagement',
                component: ChargeItemManagement
            },
            {
                path: '/charge-detail-management',
                name: 'ChargeDetailManagement',
                component: ChargeDetailManagement
            },
            {
                path: '/community-info-management',
                name: 'CommunityInfoManagement',
                component: CommunityInfoManagement
            },
            {
                path: '/building-info-management',
                name: 'BuildingInfoManagement',
                component: BuildingInfoManagement
            },
            {
                path: '/house-info-management',
                name: 'HouseInfoManagement',
                component: HouseInfoManagement
            },
            {
                path: '/parking-management',
                name: 'ParkingManagement',
                component: ParkingManagement
            }
        ]
    },










]

const router = createRouter({
    history: createWebHashHistory(),
    routes
});

export default router